<script setup lang="ts">

import { ref,onMounted, watch } from 'vue'
import { storeToRefs } from 'pinia'
import axios from 'axios'

import { useApplicationStore } from '@/stores'
import { AppInfo } from '@/core/AppInfo'
import { MenuInfo } from '@/core/MenuInfo'

const appStore = useApplicationStore()
const { routeing } = storeToRefs(appStore)

onMounted(()=>{
  loadAppSetting();
})

async function loadAppSetting(){
  
  const appSetting = await axios.get("/app-setting.json")
  appStore.setMenuAndApp(appSetting.data.appList as AppInfo[], appSetting.data.menuList as MenuInfo[]);
  
}
</script>

<template>
  <el-progress 
  style="position: fixed; left: 0;top: 0;right: 0; z-index: 99999;"
  :percentage="100"  
  :indeterminate="true" 
  :show-text="false"
  v-if="routeing"
  />
  <router-view></router-view>
</template>

<style scoped>

</style>
